package com.qf.servlet;

import com.qf.entity.MyProducts;
import com.qf.entity.Products;
import com.qf.service.MyProductsService;
import com.qf.service.impl.MyProductsServiceImpl;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/mypro")
public class MyProductsServlet extends BaseServlet {

    private MyProductsService service = new MyProductsServiceImpl();

    private void findByUid(HttpServletRequest req, HttpServletResponse resp){
        String uidStr = req.getParameter("uid");
        int uid = Integer.parseInt(uidStr);
        List<MyProducts> list = service.findByUid(uid);
        if (list.size() > 0){
            try {
                writeHTML(list,resp);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
